function [data]=load_bin(fname)

finfo=dir(fname);
fi=fopen(fname,'r');

x_res=fread(fi,1,'int16=>double');
y_res=fread(fi,1,'int16=>double');
nbr_images=round(finfo.bytes/x_res/y_res/2);

data=zeros(x_res,y_res,nbr_images,'int16');
for ind=1:size(data,3)
    data(:,:,ind)=fread(fi,[y_res x_res],'int16=>int16')';
end

fclose(fi);

 